package create;

import rx.Observable;
import rx.Subscriber;

/**
 * @author huchengchao.
 * @description:
 * @date: 2017-09-20 下午2:44
 * @Copyright: 2016 Hangzhou Enniu Tech Ltd. All rights reserved.
 */
public class RangeObservable {


    public static void main(String[] args) {
        Observable.range(1 , 10).subscribe(new Subscriber<Integer>() {
            @Override
            public void onCompleted() {
                System.out.println("Sequence Completed");
            }

            @Override
            public void onError(Throwable e) {
                System.out.println("Error: " + e.getMessage());
            }

            @Override
            public void onNext(Integer integer) {
                System.out.println("Next: " + integer);
            }
        });
    }
}
